import request from '@/utils/request'

// 查询生产退料单行列表
export function listLine(query) {
  return request({
    url: '/line/line/list',
    method: 'get',
    params: query
  })
}
// 根据id查询生产退料单行列表
export function listLine1(rtId) {
  return request.get('/line/line/list1', { params: { rtId: rtId } })

}
//根据id修改库存量-
export function updataliang(materialStockId, quantityRt) {
  return request.post(`/line/line/update1?materialStockId=${materialStockId}&quantityOnhand=${quantityRt}`)
}
// 查询生产退料单行详细
export function getLine(lineId) {
  return request({
    url: '/line/line/' + lineId,
    method: 'get'
  })
}

// 新增生产退料单行
export function addLine(data) {
  return request({
    url: '/line/line',
    method: 'post',
    data: data
  })
}

// 修改生产退料单行
export function updateLine(data) {
  return request({
    url: '/line/line',
    method: 'put',
    data: data
  })
}

// 删除生产退料单行
export function delLine(lineId) {
  return request({
    url: '/line/line/' + lineId,
    method: 'delete'
  })
}



//------------------------------采购入库模块中的物料入库单行记录
// 添加物料入库单行-采购入库
export function addWmItemRecptLine(data) {
  return request({
    url: '/line/line/addItemRecptLine',
    method: 'post',
    data: data
  })
}

//根据入库单ID编号查询物料入库单行，待修改
export function listItemRecptLine(itemRecptId) {
  return request.get('/line/line/pageItemRecptLine', { params: { itemRecptId: itemRecptId } })
}

// 修改物料入库单行
export function updateWmItemRecptLine(data) {
  return request({
    url: '/line/line/updateRecptLine',
    method: 'post',
    data: data
  })
}

// 删除物料入库单行
export function delWmItemRecptLine(data) {
  return request({
    url: '/line/line/deleteItemRecptLine',
    method: 'post',
    data: data
  })
}